#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back
#define vec vector<int>

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);return x*sgn;}

const int N = 1e5+10;

struct edge{int v,nxt;}e[N<<1];
int n,m,d,ld[N],tld[N],h[N],cnt,f[N],ans;
bool v[N];
void link(int x,int y){e[++cnt] = (edge){y,h[x]};h[x] = cnt;}

void dfs(int x,int p){
	if(v[x]) ld[x] = tld[x] = 0;
	for(int i = h[x],y;i;i = e[i].nxt){
		if((y = e[i].v) ^ p){
			dfs(y,x);
			if(ld[y] + 1 > ld[x]) tld[x] = ld[x],ld[x] = ld[y] + 1; else tld[x] = max(ld[y] + 1,tld[x]);
		}
	}
}

void dp(int x,int p){
	for(int i = h[x],y;i;i = e[i].nxt){
		if((y = e[i].v) ^ p){
			f[y] = max(f[x] + 1,(ld[x] == ld[y] + 1) ? tld[x] + 1 : ld[x] + 1);
			dp(y,x);
		}
	}
}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in,d = in;
	for(int i = 1;i <= m;i++) v[in] = 1;
	for(int i = 1,u,v;i < n;i++) u = in,v = in,link(u,v),link(v,u);
	memset(ld,0xcf,sizeof ld); memset(tld,0xcf,sizeof tld); memset(f,0xcf,sizeof f);
	dfs(1,0); dp(1,0);for(int i = 1;i <= n;i++) if(f[i] <= d && ld[i] <= d) ans++;  printf("%d\n",ans);
	return 0;
}
